//将指定列的数据复制到指定FORM
//第一个参数是要复制的行，第二个参数表示是否为单向复制
  function copy(row,single){
	var th;
	if(row.parentElement.tagName == 'TR'){
		th = row.parentElement.parentElement.childNodes[0]; //表头
	}else{
		th = row.parentElement.childNodes[0]; //表头
	}
  	var tarName; //要复制的控件的名字
	var tempName;
  	//先将FORM中的数据复制到表格
  	if(cur_row > -1 && !single){
  		var cur_tr = cur_row_tr;
  		for(var i = 0;i<cur_tr.childNodes.length;i++){
			var cn_i = cur_tr.childNodes[i];
  			tempName = th.childNodes[i].id; //TD的ID
  			if(tempName == null || tempName == "") continue;
  			tarName = tempName.substring(easymana_tableId.length + 4);
			var cont = document.getElementById(tarName);
			if(cont == null)continue;
  			var cont_value = cont.value;
  			if(cont.getAttribute("editor") != "fckeditor2.3"){
  				if(cn_i.childNodes[0] && cn_i.childNodes[0].innerHTML != undefined){
  					cn_i.childNodes[0].innerHTML = cont_value;
				}else{
  					cn_i.innerHTML = cont_value;
  				}
  			}else{
  				var oEditor = FCKeditorAPI.GetInstance(tarName);
				var content = oEditor.GetXHTML();
				if(cn_i.childNodes[0].tagName != undefined){
					cn_i.childNodes[0].innerHTML = content;
				}
  			}
  		}
  	}
  	//将新选中的表格行数据复制到表单
	//改变选中的行
	changeBack(row);
	var ttd; //一个TD
	
	easymana_tableId = th.parentElement.parentElement.id;
	for(var i = 1;i<row.childNodes.length;i++){
		ttd = row.childNodes[i];
		if(ttd){
			//取得要复制的目的名
			tempName = th.children[i].id; //TD的ID
			if(tempName.length < 5) continue;
			//表头TD ID 的生成规则是 t_ + tablename + field
			//控件ID就是字段名
			tarName = tempName.substring(easymana_tableId.length + 4);
			var cont = eval("document." + easymana_formName + "." + tarName); //根据ID取得HTML控件
			if(!cont) continue;
			if(cont == null) continue;
			if(ttd.children[0] == undefined){
				cont.value = trim(ttd.innerText); //将td的值复制到HTML控件上
			}else if(ttd.children[0].tagName == "DIV"){
				var ttid = ttd.children[0].id;
				if(ttid.indexOf("div") > -1){
					if(cont.getAttribute("editor") == "fckeditor2.3"){
						var oEditor = FCKeditorAPI.GetInstance(tarName);
						var content = oEditor.GetXHTML();
						oEditor.SetHTML(ttd.children[0].innerHTML);
						oFCKeditor.value=ttd.children[0].innerHTML;
					}else{
						cont.value = ttd.children[0].innerHTML;
					}
				}else if(ttid.indexOf('pop') > -1){
					cont.value = ttd.children[0].innerHTML;
				}
			}
		}
	}
  }